<?php
namespace app\api\controller\v1;



class User extends Base
{
    protected $noNeedLogin = [];

    /**更新用户头像，昵称
     * @return void
     */
    public function saveuser(){
        if(isset($this->reqParams['avatar'])){
            $this->user->avatar = $this->reqParams['avatar'];
        }
        if(isset($this->reqParams['nickname'])){
            $this->user->nickname = $this->reqParams['nickname'];
        }
        if(isset($this->reqParams['truename'])){
            $this->user->truename = $this->reqParams['truename'];
        }
        if(isset($this->reqParams['mobile'])){
            $this->user->mobile = $this->reqParams['mobile'];
        }
        if($this->reqParams['avatar'] || $this->reqParams['nickname'] || $this->reqParams['truename'] || $this->reqParams['mobile']){
            $this->user->save();
        }

        $this->success("",\app\api\model\v1\User::getReturnUserInfo($this->user));
    }

}
